package com.example.attendancesystem.Mapper;


import com.example.attendancesystem.Models.CheckTime;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface CheckTimeMapper {

    /**
     * 查询打卡时间
     *
     * @return 打卡时间对象
     */
    @Select("select mor_on_time,mor_off_time,aft_on_time,aft_off_time from check_time")
    CheckTime getCheckTime();

    /**
     * 更新打卡时间
     *
     * @param updateTime 要更新的打卡时间的对象
     * @return 受到影响的条数
     */
    @Update("update check_time set mor_on_time=#{updateTime.morOnTime},mor_off_time=#{updateTime.morOffTime}," +
            "aft_on_time=#{updateTime.aftOnTime},aft_off_time=#{updateTime.aftOffTime}")
    Integer updateTime(@Param("updateTime") CheckTime updateTime);


}
